#include <iomanip>//头文件
#include <iostream>

//方法一：一次fixed + setprecision(n)
using namespace std;

int main() {

	double h;
	int n;

	cin >> h;
	cin >> n;

	double sum = h;
	h /= 2;
	for (int i = 1; i < n; i++) {
		sum += h * 2;
		h /= 2;
	}
	cout << fixed << setprecision(1) << sum << " " << setprecision(1) << h << endl;
    //        ^look here
	cout << setprecision(1) << sum << " " << setprecision(1) << h << endl;
	return 0;
}

//方法二：用cout.setf(ios::fixed) + setprecision(n)
using namespace std;

int main() {

	double h;
	int n;

	cin >> h;
	cin >> n;

	double sum = h;
	h /= 2;
	for (int i = 1; i < n; i++) {
		sum += h * 2;
		h /= 2;
	}
    cout.setf(ios::fixed);
	cout << setprecision(1) << sum << " " << setprecision(1) << h << endl;
    //        ^look here
	cout << setprecision(1) << sum << " " << setprecision(1) << h << endl;
	return 0;
}

/*参考：
*https://blog.csdn.net/m0_46515080/article/details/113574746
*https://www.bilibili.com/video/BV1684y1f7x6?t=172.9
*/